package com.itheima.tliasmanagement.controller;

import com.itheima.tliasmanagement.dto.LoginDto;
import com.itheima.tliasmanagement.service.EmpService;
import com.itheima.tliasmanagement.vo.LoginResultVo;
import com.itheima.tliasmanagement.vo.Result2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录
 * */
@RestController
public class LoginController {

    @Autowired
    private EmpService empService;

    @PostMapping("/login")
    public Result2<LoginResultVo> login(@RequestBody LoginDto dto){
        LoginResultVo vo =  empService.login(dto);
        return Result2.ok(vo);
    }
}
